﻿using Newtonsoft.Json.Linq;

namespace NetEasyMusic.Lib.Models;

public class AlbumModel
{
    public string Id { get; init; } = "";
    public string Name { get; set; } = "";
    public string PicUrl { get; set; } = "";
    public string Description { get; init; } = "";
    public string Type { get; init; } = "";
    public string SubType { get; init; } = "";
    public SongModel[] Songs { get; set; } = [];

    public static AlbumModel ReportAlbum(JToken token)
    {
        return new AlbumModel()
        {
            Id = token["albumId"]?.ToObject<string>()!,
            Name = token["albumName"]?.ToObject<string>()!,
            PicUrl = token["albumPicUrl"]?.ToObject<string>()!
        };
    }
}